home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act3 / 00277_keydwn.ls < prev    next >
Encoding:
Text File  |  1995-03-28  |  1.0 KB  |  39 lines

  1. on keyDown
  2.   global WhichBug, TxtCursor, digitalis, changer, singit
  3.   if singit = 0 then
  4.     exit
  5.   end if
  6.   set onesdigit to 42 + WhichBug
  7.   if (the key = RETURN) or (the key = ENTER) then
  8.     if value(changer) = 0 then
  9.       exit
  10.     end if
  11.     set the castNum of sprite onesdigit to getAt(digitalis, value(changer) + 19)
  12.     set TxtCursor to 0
  13.     checkit()
  14.     exit
  15.   else
  16.     if the key = BACKSPACE then
  17.       set monkey to changer
  18.       if the number of chars in monkey > 1 then
  19.         set monkey to char 1 to the number of chars in monkey - 1 of monkey
  20.         set changer to monkey
  21.       else
  22.         set changer to EMPTY
  23.       end if
  24.     else
  25.       if the number of chars in string(changer) < 2 then
  26.         if (the key >= "0") and (the key <= "9") then
  27.           if (changer = "1") and (the key = "0") then
  28.             set changer to "10"
  29.           else
  30.             set changer to the key
  31.           end if
  32.         end if
  33.       end if
  34.     end if
  35.     set the castNum of sprite onesdigit to getAt(digitalis, value(changer) + 1)
  36.   end if
  37.   updateStage()
  38. end
  39.